<?php	
$pic_id=$_GET['pic_id'];

// fetch all tags
$sql = "SELECT * FROM image_tag WHERE pic_id = '".$pic_id."' ORDER BY id DESC" ;
$qry = mysql_query($sql);
$rs = mysql_fetch_array($qry);


if ($rs){
  do{
  	$id[] = $rs['id']; 	
  	foreach($id as $key => $value)
	{
		$a=$key+1;
	}
  	
    echo '<div class="tagview" style="left:'.$rs['pic_x'].'px;top:'.$rs['pic_y'].'px;" id="view_'.$rs['id'].'">';?><li rel="<?php echo $rs['id'] ?>"><a href="tag_picture?pic_id=<?php echo $rs['link_to'] ?>"><?php echo $a; ?><img src="<?= $this->config->base_url(); ?>assets/images/add.png" ></a></li><?php echo'</div>';
  }while($rs = mysql_fetch_array($qry));
}


/*foreach($id as $key => $value) {
  echo $key+1;
}*/

?>